package com.feicheng.controller.shop.admin.client;


import com.feicheng.common.result.ResultInfo;
import com.feicheng.persistence.model.VipMain;
import com.feicheng.service.IFClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.Instant;
import java.time.ZoneOffset;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cailongyang
 * @since 2021-12-02
 */
@RestController("/shop/admin/client/vip")
@RequestMapping("/shop/admin/client/vip")
public class VipController {

    @Autowired
    IFClientService ifClientService;

    @GetMapping("/list")
    public ResultInfo hrs(
            @RequestParam(required = false ,defaultValue = "1") Integer current,
            @RequestParam(required = false ,defaultValue = "10") Integer size,
            VipMain vipMain
    ){
        return ifClientService.getVipsByPage(vipMain, current, size);
    }

    @GetMapping("/info")
    public ResultInfo getVipById(Integer vipId) {
        return ifClientService.getVip(vipId);
    }

}
